﻿#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
//编写代码实现：求⼀个整数存储在内存中的⼆进制中1的个数。
int main()
{
	int num = 0, count = 0;
	scanf("%d", &num);
	while (num)
	{
		num=num & (num-1);
		count++;
	}
	printf("count=%d\n", count);
	return 0;
}